// 数字计数器模块
import { defineStore } from 'pinia'
import { ref } from 'vue'
export const useCountStore = defineStore(
  'counter',
  () => {
    const count = ref(100)
    const addCount = (n) => {
      count.value += n
    }
    const reduceCount = (n) => {
      count.value -= n
    }
    return { count, addCount, reduceCount }
  },
  {
    persist: true // 持久化
  }
)
